<form class="form-horizontal" id="register" method="POST" action="addSave">
    <fieldset>
        <legend>Rekam Data User Baru</legend>
        <div class="control-group">
            <label class="control-label" >Nomor Induk Pegawai (NIP)</label>
            <div class="controls">
                <input type="text" name="nip" id="nrp" placeholder="nip pegawai"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >Nomor Registrasi Pokok (NRP)</label>
            <div class="controls">
                <input type="text" name="nrp" id="nrp" placeholder="nrp pegawai"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >Nama Universitas</label>
            <div class="controls">
                <input type="text" name="nama_univ" id="nama_universitas" placeholder="nama universitas"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >Nama Jurusan</label>
            <div class="controls">
                <input type="text" name="nama_jurusan" id="nama_jurusan" placeholder="nama jurusan"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" >Username</label>
            <div class="controls">
                <input type="text" name="username" id="username" placeholder="diisi nip pegawai"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Password</label>
            <div class="controls">
                <input type="password" name="password" id="password" placeholder="diisi nip pegawai"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">confirm password</label>
            <div class="controls">
                <input type="password" name="cpassword" id="cpassword" placeholder="diisi nip pegawai"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Role</label>
            <div class="controls">

                <select name="role">
                    <option value="User">User</option>
                    <option value="Admin">Admin</option>
                </select>
            </div>
        </div>
        <div class="form-actions">
            <button type="submit" name="submit" value="simpan" class="btn btn-success">simpan</button>
            <button type="cancel" name="cancel" value="batal" class="btn btn-danger">batal</button>
        </div>
    </fieldset>
</form>

<div>
    <script type="text/javascript" src="<?php echo URL.'public/js/jquery.validate.js'?>"></script>
    <script type="text/javascript">
	  $(document).ready(function(){			
			$("#register").validate({
				rules:{
					nip:"required",
                                        nrp:"required",
					
					password:{
						required:true,
						minlength: 4
					},
					cpassword:{
						required:true,
						equalTo: "#password"
					}
					
				},
				
				errorClass: "help-inline",
				errorElement: "span",
				highlight:function(element, errorClass, validClass) {
					$(element).parents('.control-group').addClass('error');
				},
				unhighlight: function(element, errorClass, validClass) {
					$(element).parents('.control-group').removeClass('error');
					$(element).parents('.control-group').addClass('success');
				}
			});
		});
	  </script>
</div>